// Kony

#pragma once

#include "CoreMinimal.h"
#include "AbilitySystem/Abilitys/BaseDamageGameplayAbility.h"
#include "ProjectileSpeellGameplayAbility.generated.h"

class ABaseProjectile;
class UGameplayEffect;
struct FGameplayTag;
/**
 * 投射物游戏能力
 */
UCLASS()
class GASC_HUANLING_API UProjectileSpeellGameplayAbility : public UBaseDamageGameplayAbility
{
	GENERATED_BODY()
public:
	//当前技能描述
	virtual FString GetDescription(int32 Level, const FText& Title, const FText& Description) override;
	//下一级技能描述
	virtual FString GetNextLevelDescription(int32 Level, const FText& Title, const FText& Description) override;
protected:
	//激活能力（Gameplay Ability System 自动调用）
	virtual void ActivateAbility(const FGameplayAbilitySpecHandle Handle, const FGameplayAbilityActorInfo* ActorInfo, const FGameplayAbilityActivationInfo ActivationInfo, const FGameplayEventData* TriggerEventData) override;

	//通过蓝图生成投射物，这样可以通过蒙太奇动画帧数通知来控制投射物生成
	//接收 位置和空间参数
	UFUNCTION(BlueprintCallable, Category = "Ability|Projectile")
	void SpawnProjectile(const FVector& ProjectileTargetLocation, const FGameplayTag& SocketTag, bool bOverridePitch = true, float PitchOverride = 0.f, AActor* HomingTarget = nullptr);
	//投射物类变量
	UPROPERTY(EditAnywhere, BlueprintReadOnly)
	TSubclassOf<ABaseProjectile> ProjectileClass;
	//发射数量
	UPROPERTY(EditDefaultsOnly)
	int32 NumProjectiles = 1;
	//是否追踪目标
	UPROPERTY(EditDefaultsOnly)
	bool bIsHoming = true;
};
